<script>
	import config from './config'
	import {
		getToken
	} from '@/utils/auth'
	import pageAnimation from "@/static/pageAnimation/animation.js"
	export default {
		globalData: {
			config: config
		},
		onLaunch: function() {
			initApp()
			pageAnimation({
				durationIn: 300,
				durationOut: 300,
				mode: "",
				auto: true,
				except: []
			});
			console.log('App Launch')
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}

	async function initApp() {
		// 检查用户登录状态
		//#ifdef H5
		checkLogin()
		//#endif
	}

	function checkLogin() {
		if (!getToken()) {
			uni.reLaunch({
				url: '/pages/login'
			})
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import '@/static/scss/index.scss';
	@import url("/static/pageAnimation/css.css");
	@import 'element-plus/dist/index.css';

</style>